# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html

import scrapy


class BaseItem(scrapy.Item):
    city = scrapy.Field()  # 城市
    districtName = scrapy.Field()  # 项目区域      !!!
    districtCode = scrapy.Field()  # 行政区划代码
    projectName = scrapy.Field()  # 项目名称
    projectSubName = scrapy.Field()  # 项目子名称
    publicName = scrapy.Field()  # 推广名称
    projectAddress = scrapy.Field()  # 项目地址
    projectUse = scrapy.Field()  # 项目用途
    estateAddress = scrapy.Field()  # 楼盘地址
    enterpriseName = scrapy.Field()  # 房地产公司名称
    createTime = scrapy.Field()  # 创建该记录的时间
    updateTime = scrapy.Field()  # 更新该记录的时间
    fetchTime = scrapy.Field()  # 抓取日期

    projectId = scrapy.Field()  # 项目id
    estateName = scrapy.Field()  # 楼盘名称
    estateId = scrapy.Field()  # 楼盘id
    developerName = scrapy.Field()  # 开发商
    preSalePermit = scrapy.Field()  # 预售许可证
    permitId = scrapy.Field()  # 许可证id
    sr = scrapy.Field()  # 房源
    siteName = scrapy.Field()  # 房源（中文名）

    isCompletionAcceptance = scrapy.Field()  # 现房/期房
    estateTypeParams = scrapy.Field()  # 类型参数

    approvalRoomNo = scrapy.Field()  # 批准套数
    approvalArea = scrapy.Field()  # 批准面积
    saleStatus = scrapy.Field()  # 销售状态
    saleAddress = scrapy.Field()  # 销售地址

    residenceAvgPrice = scrapy.Field()  # 住宅拟售价格/住宅均价    !!! 弃用
    commercialAvgPrice = scrapy.Field()  # 商业拟售价格/商业均价   !!! 弃用
    workingAvgPrice = scrapy.Field()  # 办公拟售价格/办公均价      !!! 弃用
    nonResidenceAvgPrice = scrapy.Field()  # 非住宅均价

    residenceProposedPrice = scrapy.Field()  # 住宅拟售价格
    commercialProposedPrice = scrapy.Field()  # 商业拟售价格
    officialProposedPrice = scrapy.Field()  # 办公拟售价格

    lngBd = scrapy.Field()  # 百度经度
    latBd = scrapy.Field()  # 百度纬度
    lngGd = scrapy.Field()  # 高德经度
    latGd = scrapy.Field()  # 高德纬度
    coordinate = scrapy.Field()  # 经纬度坐标

    buildingLocation = scrapy.Field()  # 楼栋坐落
    roomUse = scrapy.Field()  # 房屋用途

    parkingSpacesNum = scrapy.Field()  # 停车位
    totalRoomNo = scrapy.Field()  # 总套数
    propertyManagementFee = scrapy.Field()  # 物业管理费
    avgPrice = scrapy.Field()  # 均价
    cumulativeAvgPrice = scrapy.Field()  # 累计均价
    saleableRoomNo = scrapy.Field()  # 可售套数
    soldRoomNo = scrapy.Field()  # 已售套数
    unsoldRoomNo = scrapy.Field()  # 未售套数
    preSaleRoomNo = scrapy.Field()  # 预售套数
    reserveRoomNo = scrapy.Field()  # 预定套数

    decorateSituation = scrapy.Field()  # 装修情况
    referencePrice = scrapy.Field()  # 参考价格
    hignRefPrice = scrapy.Field()  # 最高报价
    lowRefPrice = scrapy.Field()  # 最低报价
    recordUnitPrice = scrapy.Field()  # 备案单价

    certDate = scrapy.Field()  # 发证日期
    transactionRatio = scrapy.Field()  # 成交比例

    planningPermit = scrapy.Field()  # 规划许可证/用地规划许可证
    planningUse = scrapy.Field()  # 规划用途
    planningTotalBuildingArea = scrapy.Field()  # 规划总建筑面积
    planningTotalHouseholds = scrapy.Field()  # 规划总户数
    constructionPermit = scrapy.Field()  # 施工许可证
    landPermit = scrapy.Field()  # 土地许可证
    constructionPlanningPermit = scrapy.Field()  # 工程规划许可证

    floatingRange = scrapy.Field()  # 可浮动幅度
    buildingStructure = scrapy.Field()  # 建筑结构

    handoverDate = scrapy.Field()  # 上房/交房/交付日期
    commencementDate = scrapy.Field()  # 开工日期
    completionDate = scrapy.Field()  # 竣工日期
    openingDate = scrapy.Field()  # 开盘日期
    buildDate = scrapy.Field()  # 建成日期
    orientation = scrapy.Field()  # 朝向

    forecastBuildArea = scrapy.Field()  # 预测建筑面积
    realBuildArea = scrapy.Field()  # 实测建筑面积

    residenceNum = scrapy.Field()  # 住宅套数
    nonResidenceNum = scrapy.Field()  # 非住宅套数
    salesTel = scrapy.Field()  # 销售电话


# 楼盘
class FdcEstateGuidItem(BaseItem):
    estateUrl = scrapy.Field()  # 楼盘url
    estateStatus = scrapy.Field()  # 楼盘销售状态
    projectUrl = scrapy.Field()  # 项目url
    projectNature = scrapy.Field()  # 项目性质
    projectStatus = scrapy.Field()  # 项目销售状态

    totalRoomNum = scrapy.Field()  # 总套数
    totalSoldRoomNum = scrapy.Field()  # 已售总套数
    totalUnsoldRoomNum = scrapy.Field()  # 未售总套数
    totalRoomNo = scrapy.Field()  # 总套数  !!!
    totalHouseholds = scrapy.Field()  # 总户数
    soldTotalRoomNo = scrapy.Field()  # 已售总套数  !!!
    unsoldTotalRoomNo = scrapy.Field()  # 未售总套数  !!!
    avgPrice = scrapy.Field()  # 均价
    propertyCompany = scrapy.Field()  # 物业公司
    propertyManagementFee = scrapy.Field()  # 物业管理费
    propertyType = scrapy.Field()  # 物业类型
    propertyArea = scrapy.Field()  # 物业用房面积
    propertyFee = scrapy.Field()  # 物业收费标准(单位：元/㎡*月)

    estateTotalArea = scrapy.Field()  # 建筑总面积
    buildingForm = scrapy.Field()  # 建筑形式
    floorAreaRatio = scrapy.Field()  # 容积率
    greeningRate = scrapy.Field()  # 绿化率
    qualificationCertificateNo = scrapy.Field()  # 资质证书编号
    qualificationGrade = scrapy.Field()  # 资质等级
    salesTel = scrapy.Field()  # 销售电话
    parkingSpacesNum = scrapy.Field()  # 停车位
    parkingPrice = scrapy.Field()  # 停车位价格
    parkingRental = scrapy.Field()  # 停车位租金(单位：元/㎡*月)
    parkingManagementFee = scrapy.Field()  # 车位管理费(单位：元/个*月)

    certDate = scrapy.Field()  # 发证日期
    approvalDate = scrapy.Field()  # 批准日期
    certExpiryDate = scrapy.Field()  # 有效期止
    certStartDate = scrapy.Field()  # 有效期起
    preSaleArea = scrapy.Field()  # 预售面积
    preSaleBlockName = scrapy.Field()  # 预售楼栋名称
    preSaleRoomNo = scrapy.Field()  # 预售套数
    approvalRoomNo = scrapy.Field()  # 批准套数
    approvalArea = scrapy.Field()  # 批准面积
    approvalParts = scrapy.Field()  # 批准部位
    saleableRoomNo = scrapy.Field()  # 可售套数
    saleableArea = scrapy.Field()  # 可售面积
    unsaleableRoomNo = scrapy.Field()  # 不可售套数
    unsaleableArea = scrapy.Field()  # 不可售面积
    soldRoomNo = scrapy.Field()  # 已售套数
    soldArea = scrapy.Field()  # 已售面积
    unsoldRoomNo = scrapy.Field()  # 未售套数
    unsoldArea = scrapy.Field()  # 未售面积
    CA = scrapy.Field()  # 发证机关/批准机关
    preSaleDepositBank = scrapy.Field()  # 预售资金开户银行
    preSaleAccountName = scrapy.Field()  # 预售资金账户名称
    preSaleAccountNum = scrapy.Field()  # 预售资金监管帐号
    preSaleBuilding = scrapy.Field()  # 预售楼栋

    commerceNum = scrapy.Field()  # 商业套数
    commerceArea = scrapy.Field()  # 商业面积
    residenceNum = scrapy.Field()  # 住宅套数
    residenceArea = scrapy.Field()  # 住宅面积
    officialArea = scrapy.Field()  # 办公面积
    approvalResidenceNum = scrapy.Field()  # 批准住宅套数
    approvalResidenceArea = scrapy.Field()  # 批准住宅面积
    saleableResidenceNum = scrapy.Field()  # 可售住宅套数
    saleableResidenceArea = scrapy.Field()  # 可售住宅面积
    otherNum = scrapy.Field()  # 其它套数
    otherArea = scrapy.Field()  # 其他面积
    coverageArea = scrapy.Field()  # 占地面积

    registrationDepartment = scrapy.Field()  # 登记办理部门
    landUseRightNum = scrapy.Field()  # 土地使用权证号
    landUsageTerm = scrapy.Field()  # 土地使用年限
    landUse = scrapy.Field()  # 土地用途
    landQuality = scrapy.Field()  # 土地性质
    landStartingDate = scrapy.Field()  # 土地起始日期
    landTerminalDate = scrapy.Field()  # 土地终止日期

    totalArea = scrapy.Field()  # 总面积
    totalBuildingNum = scrapy.Field()  # 总楼栋数
    totalSoldArea = scrapy.Field()  # 已售总面积
    totalUnSoldArea = scrapy.Field()  # 未售总面积
    totalSaleableRoomNum = scrapy.Field()  # 可售总套数
    totalUnSaleableRoomNum = scrapy.Field()  # 不可售总套数
    totalSaleableArea = scrapy.Field()  # 可售总面积
    totalResidenceNum = scrapy.Field()  # 住宅总套数
    totalResidenceArea = scrapy.Field()  # 住宅总面积
    totalNonResidenceArea = scrapy.Field()  # 非住宅总面积
    totalSaleableResidenceNum = scrapy.Field()  # 可售住宅总套数
    totalSoldResidenceNum = scrapy.Field()  # 已售住宅总套数
    totalSaleableNonResidenceNum = scrapy.Field()  # 可售非住宅总套数
    totalSoldNonResidenceNum = scrapy.Field()  # 已售非住宅总套数
    totalSaleableResidenceArea = scrapy.Field()  # 可售住宅总面积
    permitTotalRoomNum = scrapy.Field()  # 许可证总套数
    permitResidenceNum = scrapy.Field()  # 许可证住宅套数
    permitResidenceArea = scrapy.Field()  # 许可证住宅面积
    permitCommerceNum = scrapy.Field()  # 许可证商业套数
    permitCommerceArea = scrapy.Field()  # 许可证商业面积
    permitOtherNum = scrapy.Field()  # 许可证其他套数
    permitOtherArea = scrapy.Field()  # 许可证其他面积
    permitOfficialNum = scrapy.Field()  # 许可证办公套数
    permitOfficialArea = scrapy.Field()  # 许可证办公面积
    permitParkingSpacesNum = scrapy.Field()  # 许可证车位套数
    permitParkingSpacesArea = scrapy.Field()  # 许可证车位面积

    permitSaleableRoomNum = scrapy.Field()  # 许可证可售套数
    permitUnSaleableRoomNum = scrapy.Field()  # 许可证不可售套数
    permitUnSoldRoomNum = scrapy.Field()  # 许可证未售套数
    permitSoldRoomNum = scrapy.Field()  # 许可证已售套数
    permitTotalArea = scrapy.Field()  # 许可证总面积
    permitSaleableArea = scrapy.Field()  # 许可证可售面积
    permitStatus = scrapy.Field()  # 许可证销售状态
    permitSalesArea = scrapy.Field()  # 许可证销售范围
    permitBuildingNum = scrapy.Field()  # 许可证销售楼栋号

    constructionUnit = scrapy.Field()  # 施工单位
    designUnit = scrapy.Field()  # 设计单位
    supervisingUnit = scrapy.Field()  # 监理单位
    investmentUnit = scrapy.Field()  # 投资单位

    landPlotsNum = scrapy.Field()  # 宗地号/地块号
    estateLandPlots = scrapy.Field()  # 楼盘地块
    surrenderDate = scrapy.Field()  # 受让日期
    contractNumber = scrapy.Field()  # 合同文号

    projectBrief = scrapy.Field()  # 项目简介
    permitBrief = scrapy.Field()  # 许可证简介/信息
    handoverDate = scrapy.Field()  # 上房/交房/交付日期
    commencementDate = scrapy.Field()  # 开工日期
    planningCommencementDate = scrapy.Field()  # 计划开工日期
    completionDate = scrapy.Field()  # 竣工日期
    planningCompletionDate = scrapy.Field()  # 计划竣工日期
    buildingCategory = scrapy.Field()  # 建筑类别

    airSupply = scrapy.Field()  # 配套气
    waterWorks = scrapy.Field()  # 配套水
    electronicDevices = scrapy.Field()  # 配套电
    lift = scrapy.Field()  # 配套电梯
    orientation = scrapy.Field()  # 朝向
    buildingDensity = scrapy.Field()  # 建筑密度

    siteArea = scrapy.Field()  # 用地面积
    saleDate = scrapy.Field()  # 销售日期
    filingDepartment = scrapy.Field()  # 备案部门
    landGrade = scrapy.Field()  # 土地等级

    estateIntroduction = scrapy.Field()  # 楼盘介绍
    mainArea = scrapy.Field()  # 主力面积
    recordName = scrapy.Field()  # 备案名
    openingDate = scrapy.Field()  # 开盘日期

    communityScale = scrapy.Field()  # 社区规模
    mainStructure = scrapy.Field()  # 主力户型

    projectFileNum = scrapy.Field()  # 立项文号


# 楼栋
class FdcBuildingItem(BaseItem):
    buildingUrl = scrapy.Field()  # 楼栋url
    buildingId = scrapy.Field()  # 楼栋id
    buildingNo = scrapy.Field()  # 楼栋号
    buildingTotalArea = scrapy.Field()  # 总建筑面积
    roomTotalNo = scrapy.Field()  # 房间总数
    floorTotalNo = scrapy.Field()  # 总层数
    floorOverGroundNo = scrapy.Field()  # 地上层数
    floorUnderGroundNo = scrapy.Field()  # 地下层数
    saleStatus = scrapy.Field()  # 房号状态   !!!

    blockName = scrapy.Field()  # 楼栋名字
    soldRoomNo = scrapy.Field()  # 已售套数
    unsoldRoomNo = scrapy.Field()  # 未售套数
    saleableRoomNo = scrapy.Field()  # 可售套数
    unsaleableRoomNo = scrapy.Field()  # 不可售套数
    buildingSoldArea = scrapy.Field()  # 楼栋已售面积
    buildingUnsoldArea = scrapy.Field()  # 楼栋未售面积
    buildingSaleableArea = scrapy.Field()  # 楼栋可售面积
    buildingResidenceArea = scrapy.Field()  # 楼栋住宅面积
    buildingNonResidenceArea = scrapy.Field()  # 楼栋非住宅面积
    buildingInnerArea = scrapy.Field()  # 楼栋套内面积
    buildingStructure = scrapy.Field()  # 建筑结构
    buildingHeight = scrapy.Field()  # 楼栋高度

    systemID = scrapy.Field()  # 临时版本参数
    unitLi = scrapy.Field()  # 单元列表

    regulatoryBank = scrapy.Field()  # 监管银行
    regulatoryBankNum = scrapy.Field()  # 监管银行账号


# 房号
class FdcRoomItem(BaseItem):
    roomUse = scrapy.Field()  # 房屋用途    !!!
    roomDecoration = scrapy.Field()  # 装修情况     !!!
    roomLocation = scrapy.Field()  # 房屋坐落   !!!
    roomStructure = scrapy.Field()  # 房屋套型/户型  !!!
    roomStructureName = scrapy.Field()  # 户型名称
    bedroom = scrapy.Field()  # 室
    livingRoom = scrapy.Field()  # 厅
    bathroom = scrapy.Field()  # 卫
    buildingArea = scrapy.Field()  # 建筑面积
    innerArea = scrapy.Field()  # 套内面积
    unitPrice = scrapy.Field()  # 参考单价   !!!

    blockName = scrapy.Field()  # 楼栋名字
    buildingId = scrapy.Field()  # 楼栋id
    buildingNo = scrapy.Field()  # 楼栋号
    roomUrl = scrapy.Field()  # 房屋url
    roomFloor = scrapy.Field()  # 房屋楼层
    roomFloorName = scrapy.Field()  # 房屋楼层名称
    roomArea = scrapy.Field()  # 房屋面积
    roomId = scrapy.Field()  # 房屋id
    roomNo = scrapy.Field()  # 房号
    roomRegistrationNum = scrapy.Field()  # 房籍号
    saleStatus = scrapy.Field()  # 销售状态
    unitName = scrapy.Field()  # 单元
    unitNo = scrapy.Field()  # 单元号
    roomNature = scrapy.Field()  # 房屋性质
    forecastBuildArea = scrapy.Field()  # 预测建筑面积
    forecastInnerArea = scrapy.Field()  # 预测套内面积
    forecastSharedArea = scrapy.Field()  # 预测分摊面积
    forecastVerandaArea = scrapy.Field()  # 预测阳台面积
    realBuildArea = scrapy.Field()  # 实测建筑面积
    realInnerArea = scrapy.Field()  # 实测套内面积
    stateOfOwnership = scrapy.Field()  # 权属状态
    roomTotalPrice = scrapy.Field()  # 房屋总价
    verandaType = scrapy.Field()  # 阳台类型
    verandaCount = scrapy.Field()  # 阳台个数
    isMortgage = scrapy.Field()  # 是否抵押
    isSealedOff = scrapy.Field()  # 是否查封
    isLimitSell = scrapy.Field()  # 是否限制销售
    isElevator = scrapy.Field()  # 是否有电梯
    isDuplex = scrapy.Field()  # 是否跃层

    statusNo = scrapy.Field()  # 临时状态数字
    priceDict = scrapy.Field()  # 临时价格字典

    nominalFloor = scrapy.Field()  # 名义层
    physicsFloor = scrapy.Field()  # 物理层
    naturalFloor = scrapy.Field()  # 自然楼层
    salesFloor = scrapy.Field()  # 销售楼层

    buildingAreaUnitPrice = scrapy.Field()  # 建筑面积拟售单价
    innerAreaUnitPrice = scrapy.Field()  # 套内面积拟售单价

    pubPrice = scrapy.Field()  # 公示价格
    pubUnitPrice = scrapy.Field()  # 公示单价
    recordUnitPrice = scrapy.Field()  # 备案单价
    recordTotalPrice = scrapy.Field()  # 备案总价

    occupancyRate = scrapy.Field()  # 得房率
    floorTotalNo = scrapy.Field()  # 总层数

    seatName = scrapy.Field()  # 座号
    apportionmentArea = scrapy.Field()  # 分摊面积
    apportionmentCoefficient = scrapy.Field()  # 分摊系数

    undecoratedPrice = scrapy.Field()  # 挂牌清水价
    decoratedPrice = scrapy.Field()  # 装修价
    structure = scrapy.Field()  # 户型结构(平层、跃层)
    floorHeight = scrapy.Field()  # 层高

    buildingZoning = scrapy.Field()  # 分区


class SfItem(scrapy.Item):
    province = scrapy.Field()  # 省
    city = scrapy.Field()  # 城市
    categoryName = scrapy.Field()  # 标的物类型
    districtName = scrapy.Field()  # 行政区域/区县
    caseId = scrapy.Field()  # 案例id
    caseTitle = scrapy.Field()  # 案例标题
    caseStatus = scrapy.Field()  # 案例状态
    caseUrl = scrapy.Field()  # 案例url
    currentPrice = scrapy.Field()  # 当前价
    consultPrice = scrapy.Field()  # 评估价
    marketPrice = scrapy.Field()  # 市场价
    initialPrice = scrapy.Field()  # 起拍价
    marginMoney = scrapy.Field()  # 保证金
    viewerCount = scrapy.Field()  # 围观次数
    bidCount = scrapy.Field()  # 出价次数
    delayCount = scrapy.Field()  # 延时次数
    applyCount = scrapy.Field()  # 报名人数
    startTime = scrapy.Field()  # 开始时间
    endTime = scrapy.Field()  # 结束时间
    imageUrls = scrapy.Field()  # 图片url(列表)         请勿随意修改!!!
    imagesInfo = scrapy.Field()  # 图片保存的相关信息   请勿随意修改!!!
    auctionNotice = scrapy.Field()  # 竞买/应买公告
    auctionInstruction = scrapy.Field()  # 竞买/应买须知
    description = scrapy.Field()  # 标的物介绍
    purchaseConfirm = scrapy.Field()  # 竞价成功确认书信息
    bidRecords = scrapy.Field()  # 竞买/应买记录
    mediaUrl = scrapy.Field()  # 案例视频url
    attachmentInfo = scrapy.Field()  # 附件信息
    fetchTime = scrapy.Field()  # 抓取时间
    updateTime = scrapy.Field()  # 更新时间
    createTime = scrapy.Field()  # 创建时间
